﻿using System.Collections.Generic;

namespace RoomyDungeonGenerator
{
	/// <summary>Represents a rectangular area of tiles, with information about entrances and connected rooms.</summary>
	public class Room
	{
		/// <summary>The x-coordinate of the upper left corner of the room</summary>
		public int X { get; private set; }
		/// <summary>The y-coordinate of the upper left corner of the room</summary>
		public int Y { get; private set; }
		/// <summary>The width of the room</summary>
		public int W { get; private set; }
		/// <summary>The height of the room</summary>
		public int H { get; private set; }
		/// <summary>The collection of tiles along the room's edge that are the start of corridors to other rooms</summary>
		public List<Tile> Entrances { get; set; }
		/// <summary>The collection of all rooms that are directly connected to this room</summary>
		public List<Room> ConnectedRooms { get; set; }

		/// <summary>
		/// Initializes a new room.
		/// </summary>
		/// <param name="x">The x-coordinate of the upper left corner of the room</param>
		/// <param name="y">The y-coordinate of the upper left corner of the room</param>
		/// <param name="w">The width of the room</param>
		/// <param name="h">The height of the room</param>
		public Room(int x, int y, int w, int h)
		{
			X = x;
			Y = y;
			W = w;
			H = h;
			ConnectedRooms = new List<Room>();
			Entrances = new List<Tile>();
		}
	}
}
